﻿<!--#include file="../base.asp"-->
<!--#include file="FCKeditor/fckeditor.asp" -->
<%if IsLogin then %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提交作业</title>
<link href="../skin/default/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<%
dim contid,sql,rs,rswp
contid=request.QueryString("workid")
sql="select * from work where workID="&contid&" and [delete]=0 and datediff(day,startDate,getdate())>=0 and datediff(day,stopDate,getdate())<=0"
set rs=GetRecordset(sql,0)
if not rs.eof and not rs.bof then

sql="select * from workpost where workID="&contid&" and userNum='"&request.Cookies("username")&"' and [delete]=0"
set rswp=GetRecordset(sql,0)
if not rswp.eof and not rs.bof then
    if rswp("commContent")<>"" and rswp("commJudge")<>"" then
        showMsg "作业已批改，不能再提交",3,""
        response.Write("<script language='javascript'>window.location='comm/list_submitwork.aspx';</script>")
    end if
end if
%>
<form action="save_workpost.asp?contid=<%=contid%>" method="post">
<table border="0" width="100%">
<tr><td colspan="4">提交作业</td></tr>
  <tr>
    <td style="font-weight:bold;">状态：</td>    
    <td>
    <%
    if not rswp.eof and not rswp.bof then    
    %>
    已提交(<font style="color:Red;">重复提交将覆盖原内容</font>)
    <%    
    else
    %>
    未提交
    <%
    end if
    %></td>    
    <td style="font-weight:bold;">开始日期：</td>
    <td><%=rs("startDate")%></td>
  </tr>
  <tr>
    <td style="font-weight:bold;">标题：</td>    
    <td><%=rs("title")%></td>    
    <td style="font-weight:bold;">截止日期：</td>
    <td><%=rs("stopDate")%></td>
  </tr>
  <tr>
    <td class="td_vlign" style="font-weight:bold; vertical-align:top;">内容：</td>
    <td colspan="3">
    <%
         Dim sBasePath
         sBasePath = "fckeditor/"
         Dim oFCKeditor
         Set oFCKeditor = New FCKeditor
         oFCKeditor.BasePath	= sBasePath
         oFCKeditor.Config("AutoDetectLanguage") = False
         oFCKeditor.Config("DefaultLanguage")    = "zh-cn"
         oFCKeditor.Value	= ""
         oFCKeditor.Create "content"
  	%>
  	</td>
  </tr>
  <tr>
    <td style="font-weight:bold;">上传：</td>
    <td colspan="3"><iframe src="upload.asp" width="100%" height="24" frameborder="0" scrolling="no"></iframe></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;<input type="submit" value="提交" />&nbsp;&nbsp;<input type="reset" value="重置" /></td>
  </tr>
</table>
</form>
<%
else showMsg "没有相关内容",4,""
end if
rs.close
set rs=nothing
CloseDataBase
%>
</body>
</html>
<%end if %>